package com.nsxy.manager.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import com.nsxy.manager.common.interceptors.CommonInterceptor;

/**
 * @author 潜行的青衣
 * @see
 */
@Order(50)
@Configuration
public class InterceptorConfig {

	@Bean
	public RequestMappingHandlerMapping requestMappingHandlerMapping() {
		RequestMappingHandlerMapping mapping = new RequestMappingHandlerMapping();
		mapping.setInterceptors(new Object[]{this.commonInterceptor()});
		return mapping;
	}
	
	@Bean
	public CommonInterceptor commonInterceptor() {
		return new CommonInterceptor();
	}
	
}
